<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>

    var obj = {name: '哈哈哈', age: 19, sex: '男'}

    console.log(s)
    for (var key in obj) {
    //  console.log(key) // key获取属性名
      //console.log(obj[key]) // 属性的值
      console.log('属性名：' + key + ':属性值' + obj[key])
    }
  </script>
</body>
</html>